<include file="Public:header" />
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/chart/highcharts.js"></script>
<script src="__PUBLIC__/js/chart/modules/exporting.js"></script>
<style>
	body{
		overflow-y: hidden;
	}
	table tr td{min-width: 50px;text-align: center;}
	table tr {height: 50px;}
	#oDivL_tab_Test3{background-color: #fff;z-index: inherit !important;}
	.table{max-width: none;}
	.tabTh{background-color: #fff;}

	.ibox-span{
		float: left;
		line-height: 30px;
	}
</style>
<script>
$(function(){
	var scroll_width = 10;
	$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-20);
	$(window).resize(function(){
		$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-20);
		$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width());
		$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	});
	$(".nicescroll").niceScroll({
		cursorcolor: "#999",//#CC0071 光标颜色
	    cursoropacitymax: 0.4, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
	    touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
	    cursorwidth: scroll_width+"px", //像素光标的宽度
	    cursorborder: "0", //     游标边框css定义
	    cursorborderradius: "3px",//以像素为光标边界半径
	    autohidemode: false, //是否隐藏滚动条
	    zindex:100,
	    background:"#F3F3F5",//滚动条背景色
	});
	$("#tab_Test3").FrozenTable(1,0,1);
	$("#oDivL_tab_Test3").height($("#table_div").height()).width($("#oTableLH_tab_Test3").width());
	$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width());
});
</script>
<div class="wrapper wrapper-content ">
	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<include file="Public:analytics_left" />
				<div class="col-lg-10">
					<div class="ibox-content" style="padding-bottom:10px;border-bottom: none;">
						<include file="Public:alert" />
						<div class="row">
							<div class="col-lg-2">
								<div class="pull-left" >
									<span style="font-size: 18px;color: #000;">
										考勤统计
									</span>
								</div>
							</div>
							<div class="col-lg-5">
								<div class="nav pull-left" >
									<div class="input-group">
										<select name="search_year" id="search_year" class="form-control search_time" >
											<volist name="year_array" id="vo">
												<option value="{$vo}" <if condition = "$search_time_year eq $vo">selected</if>>{$vo}年</option>
											</volist>
										</select>
									</div>
								</div>
								<div class="nav pull-left" style="margin-left:15px;">
									<div class="input-group">
										<select name="search_month" id="search_month" class="form-control search_time" >
											<volist name="month_array" id="vo">
												<option value="{$vo}" <if condition = "$search_time_month eq $vo">selected</if>>{$vo}月</option>
											</volist>
										</select>
									</div>
								</div>
								<div class="nav pull-left" style="margin-left:15px;">
									<div class="input-group">
										<select name="role" id="role" class="form-control search_time" >
											<option value="all">全部员工</option>
											<volist name="roleList" id="vo">
												<option value="{$vo['role_id']}">{$vo['full_name']}</option>
											</volist>
										</select>
									</div>
								</div>
							</div>
							<div class="col-lg-5">
								<div class="pull-right" >
									<div class="table-content" style="font-size: 12px;">
										<div class="ibox-span">
											<i class="fa fa-circle" style="color:  #d3a005;"></i>
											<span>迟到</span>
										</div>
										<div class="ibox-span">
											<i class="fa fa-circle" style="color: #1ab394;"></i>
											<span>早退</span>
										</div>
										<div class="ibox-span">
											<i class="fa fa-circle" style="color: #5e916f;"></i>
											<span>迟&退</span>
										</div>
										<div class="ibox-span">
											<i class="fa fa-circle" style="color: #0e6387;"></i>
											<span>缺卡</span>
										</div>
										<div class="ibox-span">
											<i class="fa fa-circle" style="color: #ef4344;"></i>
											<span>旷工</span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="ibox-content " id="right_height" style="border-top: none;">
						<div class="th_content" style="position:relative;">
							<div id="table_div" class="nicescroll">
								<table class="table table-hover table-striped table_thead_fixed table-bordered" id="tab_Test3" >
									<tr class="tabTh">
										<td style="min-width:170px;padding-left: 15px;text-align: left;">员工</td>
										<td>出勤（天）</td>
										<td>迟到（次）</td>
										<td>早退（次）</td>
										<td>缺卡（次）</td>
										<td>旷工（天）</td>
										<td>本月共休息（天）</td>
										<for start="1" end="$days" comparison="elt" step="1" name="a" >
									    	<td style="width: 50px;<if condition="in_array($a,$week_array)">color:#ed5565 !important;</if>" >
									    		<if condition ="strlen($a) eq 1">0</if>{$a}
									    	</td>
		    							</for>
									</tr>
									<tbody>
										<volist name="role_list" id="vo">
											<tr>
												<td style="padding-left: 15px;text-align: left;">
													<a class="role_info" rel="{$vo.role_id}" href="javascript:void(0)">
														<if condition="$vo['thumb_path']">
															<img class="img-circle" style="width:32px;height:32px;" src="{$vo['thumb_path']}"/>
														<else/>
															<img class="img-circle" style="width:32px;height:32px;" src="__PUBLIC__/img/avatar_default.png"/>
														</if>
														<span>{$vo['full_name']}</span>
													</a>
												</td>
												<td><a href="{:U('kaoqin/record','role_id='.$vo['role_id'].'&year='.$search_time_year.'&month='.$search_time_month)}">{$vo['chuqin']}</a></td>
												<td><a href="{:U('kaoqin/record','role_id='.$vo['role_id'].'&status=2&year='.$search_time_year.'&month='.$search_time_month)}">{$vo['chidao']}</a></td>
												<td><a href="{:U('kaoqin/record','role_id='.$vo['role_id'].'&status=3&year='.$search_time_year.'&month='.$search_time_month)}">{$vo['zaotui']}</a></td>
												<td>{$vo['queka']}</td>
												<td>{$vo['kuanggong']}</td>
												<td>{$vo['xiuxi']}</td>
												<volist name="vo['kaoqin_type']" id="voo">
													<td style="font-size:12px;">
														<if condition = "$voo['type'] eq 1">
															<a href="{:U('kaoqin/record','daka_time='.$voo['search_daka_time'].'&department=all&role='.$vo['role_id'])}" title="{$voo['title']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #e4eaec;text-align: center;display:block;padding:6px 0;" >正常</span>
															</a>
														<elseif condition = "$voo['type'] eq 2" />
															<a href="{:U('kaoqin/record','daka_time='.$voo['search_daka_time'].'&department=all&role='.$vo['role_id'])}" title="{$voo['title']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #5e916f;text-align: center;display:block;padding:6px 0;" >迟&退</span>
															</a>
														<elseif condition = "$voo['type'] eq 3" />
															<span style="color: #868a8d;height: 30px;width: 30px;border-radius: 50%;background-color: #e4eaec;text-align: center;display:block;padding:6px 0;" title="休息">休息</span>
														<elseif condition = "$voo['type'] eq 4" />
															<a href="javascript:void(0)" title="{$voo['title']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #0e6387;text-align: center;display:block;padding:6px 0;" >缺卡</span>
															</a>
														<elseif condition = "$voo['type'] eq 5" />
															<a href="{:U('kaoqin/record','daka_time='.$voo['search_daka_time'].'&department=all&role='.$vo['role_id'])}" title="{$voo['title']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color:  #d3a005;text-align: center;display:block;padding:6px 0;" >迟到</span>
															</a>
														<elseif condition = "$voo['type'] eq 6" />
															<a href="{:U('kaoqin/record','daka_time='.$voo['search_daka_time'].'&department=all&role='.$vo['role_id'])}" title="{$voo['title']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #1ab394;text-align: center;display:block;padding:6px 0;" >早退</span>
															</a>
														<elseif condition = "$voo['type'] eq 7" />
															<a target="_blank" href="{$voo['url']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #FFBDBD;text-align: center;display:block;padding:6px 0;" title="请假">请假</span>
															</a>
														<elseif condition = "$voo['type'] eq 8" />
															<a target="_blank" href="{$voo['url']}">
																<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #FFE0B3;text-align: center;display:block;padding:6px 0;" title="出差">出差</span>
															</a>
														<elseif condition = "$voo['type'] eq 9" />
															<span style="color: #fff;height: 30px;width: 30px;border-radius: 50%;background-color: #ef4344;text-align: center;display:block;padding:6px 0;" title="旷工">旷工</span>
														</if>
													</td>
												</volist>
											</tr>
										</volist>
									</tbody>
								</table>
							</div>
							<div id="tfoot_div" class="clearfix">
								<div class="clearfix" id="tfoot_page">
									{$page}
								</div>
							</div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="" style="display:none;" id="dialog-role-info" title="{:L('USER_INFO')}">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div class="" style="display:none;" id="dialog-commun_list" title="沟通记录">
	<div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<script type="text/javascript">
	if('{$_GET['role']}'){
		$('#role').val('{$_GET['role']}');
	}else{
		$('#role').val('all');
	}

	$(".search_time").change(function(){
		var search_year = $('#search_year').val();
		var search_month = $('#search_month').val();
		var role = $('#role').val();
		window.location.href="{:U('kaoqin/analytics','&search_year=')}"+search_year+'&search_month='+search_month+'&content_id=2&department=all'+'&role='+role;
	});

	$("#dialog-role-info").dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		maxHeight: 550,
		position: ["center",100]
	});

	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});

	$("#dialog-commun_list").dialog({
		autoOpen: false,
		modal: true,
		width: 600,
		maxHeight: 550,
		position: ["center",100]
	});

	$(".commun_list").click(function(){
		var role_id = $(this).attr('rel');
		var sdate = $(this).attr('rel1');
		$('#dialog-commun_list').dialog('open');
		$('#dialog-commun_list').load('{:U("log/commun_list","role_id=")}'+role_id+'&search_time='+sdate);
	});
</script>
<include file="Public:footer" />
